/**
 * Upper case first char
 * @param {String} string
 */
export function uppercaseFirst (string) {
  return string.charAt(0).toUpperCase() + string.slice(1)
}

/**
 * 通用状态过滤器
 * @param value
 * @returns {*}
 */
export function stateFilter (value) {
  const map = {
    0: '正常',
    1: '禁用'
  }
  return map[value]
}

export function quTypeFilter (value) {
  const map = {
    1: '单选题',
    2: '多选题',
    3: '判断题',
    4: '简答题'
  }
  return map[value]
}

export function paperStateFilter (value) {
  const map = {
    0: '考试中',
    1: '待阅卷',
    2: '已考完',
    3: '!已弃考'
  }
  return map[value]
}

export function examOpenType (value) {
  const map = {
    1: '完全公开',
    2: '部门开放',
    3: '指定人员'
  }
  return map[value]
}

export function examStateFilter (value) {
  const map = {
    0: '进行中',
    1: '已禁用',
    2: '待开始',
    3: '已结束'
  }
  return map[value]
}
export function levelFilter (value) {
  const map = {
    0: '简单',
    1: '较难'
  }
  return map[value]
}
